package org.jvm.weechat;

import java.io.*;
import java.net.Socket;
import java.nio.channels.SocketChannel;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) {
        try {
            Socket socket= new Socket("localhost",6666);

            Socket socket1= new Socket("localhost",6666);
            InputStream is= socket.getInputStream();
            BufferedReader br =new BufferedReader(new InputStreamReader(is));
            String state=br.readLine();

            System.out.println("state:"+state);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * 开始聊天
     */
    private static void chat() {
        try {
            Socket socket= new Socket("localhost",7777);


            OutputStream os=socket.getOutputStream();
            PrintStream pw=new PrintStream(os);
            pw.println( "aaa");
            pw.flush();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
